{include file="common/head_s"/}
<style type="text/css">
.layui-table-view{ margin: 0px!important; }
</style>
<div class="main">  
    <div class="layui-card-header">结算管理</div> 
    <div class="demoTable pd15 layui-form">  
        <a class="layui-btn layui-btn-primary" href="{:url(add)}" >提交提现申请</a>  
        <a class="layui-btn layui-btn-primary" href="{:url(addbank)}">添加收款账号</a>  
        <a class="layui-btn layui-btn-primary" href="{:url(banklist)}">结算卡列表</a>  
    </div> 
    <div class="demoTable pd15 layui-form">  
        <div class="layui-inline"> 
            <input type="text" class="layui-input" id="timess" placeholder="选择日期" style="width: 350px"> 
        </div>
        <button class="layui-btn layui-btn-primary" id="search" data-type="reload">搜索</button> 
        <button class="layui-btn layui-btn-primary" id="tototal" data-type="reload">统计</button> 
    </div> 
    <div class="pd15" style="padding-top: 0px;">
        <table class="layui-table layui-hide" id="total" lay-filter="tototal"></table>
        <br />
        <table class="layui-table layui-hide" id="orderlist" lay-filter="listss"></table>
    </div> 
</div>
<!-- <script type="text/html" id="topNav">
    <a href="{:url('index')}" class="layui-btn layui-btn-sm"><i class="layui-icon">&#xe857;</i>全部订单明细</a> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('today')"><i class="layui-icon">&#xe857;</i>今日订单明细</div> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('yesterday')"><i class="layui-icon">&#xe857;</i>昨日订单明细</div> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('week')"><i class="layui-icon">&#xe857;</i>本周订单明细</div> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('last week')"><i class="layui-icon">&#xe857;</i>上周订单明细</div> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('month')"><i class="layui-icon">&#xe857;</i>本月订单明细</div> 
    <div class="layui-btn layui-btn-sm layui-btn-primary" onclick="orderquan('last month')"><i class="layui-icon">&#xe857;</i>上月订单明细</div> 
</script>   -->
<script type="text/html" id="payinfo">
    {{# if(d.bankid){ }}<div onmouseover="layer.tips('{{d.bank_name}}<br>收款账号：{{d.bank_no}}<br>支付时间：{{d.paytime}}',this,{area: 'auto',tips: [1, '#333']});" onmouseout="layer.closeAll();">{{d.payname}}</div>{{# } }} 
</script> 
<script src="/static/plugins/layui/layui.js"></script> 
<script>
    layui.use(['table','form','laydate'], function() { 
        var table = layui.table,form = layui.form, $ = layui.jquery,laydate = layui.laydate;
        laydate.render({
            elem: '#timess',range: true,type: 'datetime'
        });
        tableIn = table.render({
            id: 'listss',
            elem: '#orderlist',
			toolbar: '#topNav',
            url: '{:url("index")}',
            method: 'post', 
            page: true,
            cols: [[  
                {field: 'id', title: 'ID',align: 'center', width:50, fixed: true},
                {field: 'type', title: '所属类型',align: 'center', width: 100, fixed: true},
                {field: 'typename', title: '所属商户',align: 'center', width: 100, fixed: true},
                {field: 'paytype', title: '收款类型',align: 'center', width: 100, fixed: true},
                {field: 'payname', title: '收款账号',align: 'center', width: 100, fixed: true},
                {field: 'cash', title: '提现金额',align: 'center', width: 100},
                // {field: 'fei_money', title: '手续费',align: 'center', width: 120},
                {field: 'mobile', title: '预留电话',align: 'center', width: 100},
                {field: 'status', title: '下发状态',align: 'center', width: 100},      
                {field: 'addtime', title: '提交时间',align: 'center', width: 160}, 
                {field: 'endtime', title: '审核通过时间',align: 'center', width: 160},    
                {field: 'note', title: '备注信息',align: 'center', width: 120},    
            ]],
            limit: 10 //每页默认显示的数量
        });  
        //搜索
        $('#search').on('click', function() {
            var timess = $('#timess').val();
            if($.trim(timess)==='') {
                layer.msg('请输入时间！',{icon:0});
                return;
            }else{
                tableIn.reload({ page: {page: 1},where: {timess: timess}});
            } 
        });
         //统计
         totalIn = table.render({ 
            id: '#totals',      
            elem: '#total',
            url: '{:url("total")}',
            method: 'post', 
            cols: [[ 
                {field: 'order_total', title: '<span style="color: orange;">商户订单总额</span>',align: 'center', width:200, fixed: true},
                {field: 'income', title: '<span style="color: green;">商户手续费</span>',align: 'center', width:200, fixed: true},
                {field: 'cash', title: '<span style="color: green;">已提现总额</span>',align: 'center', width:200, fixed: true},
                {field: 'shop_total', title: '<span style="color: red;">商户余额</span>',align: 'center', width:200, fixed: true},
                {field: 'today_order_total', title: '<span style="color: orange;">今日商户订单总额</span>',align: 'center', width:200, fixed: true},
                {field: 'today_income', title: '<span style="color: green;">今日商户手续费</span>',align: 'center', width:200, fixed: true},
                {field: 'today_cash', title: '<span style="color: green;">今日提现总额</span>',align: 'center', width:200, fixed: true},
                // {field: 'shop_total', title: '<span style="color: red;">商户余额</span>',align: 'center', width:200, fixed: true},
            ]],
            // limit395 391: 60 //每页默认显示的数量258998 96197 40053 134 9
        });
        $('#tototal').on('click', function() {
            var timess = $('#timess').val();
            if($.trim(timess)==='') {
                layer.msg('请输入时间！',{icon:0});
                return;
            }else{
                totalIn.reload({ page: {page: 1},where: {timess: timess}});
            } 
        });
        
    });

</script>
</body>
</html>